﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Thuoc24h.Business;

namespace Thuoc24h.AdminCP.Layouts
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        private int _contact = 1;
        private int _customerOrder = 2;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                var radMenuItem = new RadMenuItem();
                radMenuItem.Text = "Tin nhắn (" + ReviewRepository.CountUnRead(_contact) + " Tin mới)";
                radMenuItem.NavigateUrl = "/AdminCP/Pages/Contact.aspx";
                radMenuItem.ImageUrl = "/AdminCP/Layouts/Images/SmallIcon/47.png";
                RadMenu1.Items.Insert(1, radMenuItem);


                var radMenuItem2 = new RadMenuItem();
                radMenuItem2.Text = "Yêu cầu đơn thuốc (" + ReviewRepository.CountUnRead(_customerOrder) + " đơn mới)";
                radMenuItem2.NavigateUrl = "/AdminCP/Pages/CustomerOrder.aspx";
                radMenuItem2.ImageUrl = "/AdminCP/Layouts/Images/SmallIcon/27.png";
                RadMenu1.Items.Insert(2, radMenuItem2); 
            }
        }
    }
}